﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace ACM.MES.Migrations
{
    /// <inheritdoc />
    public partial class operation : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "MESOperations",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    OpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true, comment: "标准工序代号"),
                    Description = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false, comment: "说明"),
                    Remark = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: false, comment: "备注"),
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
                    DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MESOperations", x => x.Id);
                });

            migrationBuilder.CreateIndex(
                name: "IX_MESOperations_OpCode",
                table: "MESOperations",
                column: "OpCode");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "MESOperations");
        }
    }
}
